Repository navigation
🎨 Palette: setup wizard keeps focus when a connect button is redrawn - #369
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014GBDV8RURMEANJGXGHJsZw
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Three wizard actions redraw the whole step and replace the control the keyboard user just pressed, so focus falls to
<body>(WCAG 2.4.3 Focus Order): "Sign in with Plex" (startPlexConnect), "Use another Plex account" (plexConnectAgain) and Jellyfin "Connect another server" (jellyfinConnectAgain). Keyboard users must Tab from the top of the page again.Evidence (Playwright, static server + mocked
/api, calling the handlers with focus on the pressed control):document.activeElementafter each =BODY,BODY,BODY.Change
After the redraw, focus the control that took its place:
#plex-connect-btn(twice) and#s-jellyfin-url. 3 lines infrontend/js/setup.js.Measured effect / proof
Same probe after the change:
BUTTON#plex-connect-btn,BUTTON#plex-connect-btn,INPUT#s-jellyfin-url.Tests
tests/test_a11y_nav.py::test_setup_connect_redraws_keep_focusruns the three real functions in node with fakes (focus only counts after the redraw). Before: 3 failed. After: 42 passed, 0 failed. Full battery: 356/357; the only failure is the known sandbox-onlytest_enrichment_status_perf.py(SQLite planner), which fails identically on untouched main.Risk & edge cases
Optional chaining, so no-op if the element is absent. Focus is only moved in handlers triggered by a user press. Plex poll completion/expiry redraws are untouched (focus is in the plex.tv tab then). No new text, no i18n changes.
Duplicate check
Searched open/closed PRs (focus setup plex), the last 300 commits, and the Palette journal. Related: #354 (radios) and #361 (Next/Back) are different handlers.
Generated by Claude Code